<?php
function baseurl() {	
	$protocol = !empty($_SERVER ['HTTPS']) ? "https" : "http";
	return rtrim($protocol . "://" . $_SERVER ['HTTP_HOST'] .dirname($_SERVER ['SCRIPT_NAME']),"/");
}